package com.yh.patterns.state.job;

/**
 * @Author:云尚
 * @Description:高手级状态类
 */
public class ProfessionalState extends State {
    public ProfessionalState(State secondaryState) {
        this.rankName = "高手级";
        this.player = secondaryState.player;
        this.point = secondaryState.point;
    }
    public void doubleScore(){
        System.out.println(rankName+"玩家"+player.getName()+"使用积分翻倍+20");
        point+=20;
        checkState(point);
    }
    public void changeCards(){
        System.out.println(rankName+"玩家"+player.getName()+"换牌");
    }
    @Override
    public void checkState(int point) {
        if(point>=60){
            player.setState(new FinalState(this));
        }else if(point<50){
            player.setState(new SecondaryState(this));
        }
    }
}
